﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Movie.Master" AutoEventWireup="true" CodeBehind="Movie_List.aspx.cs" Inherits="MovieWebApp.Pages.Movie_List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table>
<tr><td>
<asp:DataList RepeatLayout = "Table" RepeatColumns = "4" CellPadding = "20"
    RepeatDirection = "Horizontal" ItemStyle-BorderStyle = "Double"
    runat = "server" ID = "pList" 
        onselectedindexchanged="pList_SelectedIndexChanged">
        <ItemTemplate>
        
        <asp:Image ID = "mveImage" runat = "server"
         ImageUrl = '<%# Eval("movieImage", "~/Images/{0}") %>'/>
        
        <%# DataBinder.Eval(Container.DataItem, "movieTitle") %><br />
        <%# DataBinder.Eval(Container.DataItem, "movieDesc") %><br />
        <%# String.Format("{0:c}",Convert.ToDecimal
        (DataBinder.Eval(Container.DataItem, "listPrice")))%><br />  
<asp:LinkButton ID = "AddToCart" CommandName = '<%#Container.ItemIndex %>' 
    runat = "server" OnClick = "AddToCartLink">Add To Cart</asp:LinkButton>       
        </ItemTemplate>
</asp:DataList>
</td></tr>
</table>
</asp:Content>

<%--        <asp:Image ImageUrl = "<%# Eval("movieImage", "~/Images/{0}") %>" 
        ID = "movieImage" runat = "server" /> --%>